#ifndef CLOCK_H
#define CLOCK_H

#include <QWidget>
#include <QPainter>
#include <QPaintEvent>
#include <QTime>
#include <QTimer>




class Clock : public QWidget
{
    Q_OBJECT

public:
    Clock(QWidget *parent = nullptr);
    ~Clock();

public:
    QPoint  hourHand[4];                //时针指针
    QPoint  minuteHand[4];            //分针指针
    QPoint  secondHand[4];            //秒针指针


public:
    //事件响应函数重写，函数名一定要写对：
    void paintEvent(QPaintEvent* ev);                           //绘图事件
    void onDrawClockDialog(QPainter* painter);        //绘制钟表盘
    void onDrawHourHand(QPainter* painter);           //绘制时针指针
    void onDrawMinuteHand(QPainter* painter);       //绘制分指针
    void onDrawSecondHand(QPainter* painter);      //绘制秒针指针
};
#endif // CLOCK_H
